<template>
	<view class="box">
		<view class="content">
			<view class="num">￥<text>5000</text></view>
			<view class="tit">账户余额</view>
		</view>
		<view class="recharge-list">
			<view class="company-item" :class="{'active': isChange == index}"  v-for="(item, index) in money" :key="index" @click="clickBtn(index)">
					{{item}}
				</view>
		</view>
		<button type="default" hover-class="common-hover">立即充值</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				money: ['￥1000','￥2000','￥3000'],
				isChange:'0', //单选
			}
		},
		methods: {
			clickBtn(index){
					// 单选
					if(index!=this.isChange){
						this.isChange = index;
					}else{
						// this.isChange = -1;    //不注释则可以点击取消，注释之后点击就不再取消
					}
				},
		},
		
	}
</script>

<style lang='scss'>
	.box{
		padding: 0 30rpx;
		box-sizing: border-box;
		.num{
			text-align: center;
			font-weight: bold;
			font-size: 35rpx;
			margin: 60rpx auto;
			text{
				font-size: 70rpx;
				margin-left: 10rpx;
			}
		}
		.tit{
			border-left: 4rpx solid #FF4545;
			padding-left: 15rpx;
			line-height: 30rpx;
			color: #333;
			margin-bottom: 30rpx;
		}
		.recharge-list{
			display: flex;
			justify-content: space-between;
			align-items: center;
		}
		.company-item{
			width:200rpx;
			height:70rpx;
			border:2rpx solid #666;
			border-radius:10rpx;
			font-size:34rpx;
			color:#666;
			text-align: center;
			line-height: 70rpx;
		}
		.active{
			border:2rpx solid #FF4545;
			color: #FF4545;
		}
		button{
			width: 100%;
			height: 80rpx;
			background-color: #FF4545 ;
			border-radius: 10rpx;
			color: #fff;
			font-size: 26rpx;
			margin-top: 40rpx;
		}
	}
</style>
